import * as types from '../constants/ActionTypes';

const initialState = {
  saleFilterObj: {},
  FilterObjMy: {},
  FilterObjOther: {},
  FilterObjChannel: {},
};

const SaleChanceFilterReducer = (state = initialState, action) => {
  switch (action.type) {
    case types.SALE_CHANCE_FILTER:
      return ({ ...state,
        ...{
          saleFilterObj: action.saleFilterObj,
        } });
    case types.MYCUSTOMER_FILTER:
      return ({ ...state,
        ...{
          FilterObjMy: action.FilterObjMy,
        } });
    case types.OTHER_CUSTOMER_FILTER:
      return ({ ...state,
        ...{
          FilterObjOther: action.FilterObjOther,
        } });
    case types.CHANNEL_FILTER:
      return ({ ...state,
        ...{
          FilterObjChannel: action.FilterObjChannel,
        } });
    default:
      return state;
  }
};

export default SaleChanceFilterReducer;
